import { IForm } from '@/base-ui/form'
export const loginConfig: IForm = {
  formStyle: {
    padding: '20px 0px'
  },
  formItems: [
    {
      field: 'name',
      type: 'input',
      lable: '账号',
      placeholder: '请输入账号',
      rules: [
        {
          required: true,
          message: '账号不能为空',
          trigger: 'blur'
        },
        {
          pattern: /^[a-z0-9]{4,10}$/,
          message: '账号是字母和数字长度为4-10位',
          trigger: 'blur'
        }
      ],
      otherOptions: {
        autosize: true,
        maxlength: 10,
        clearable: true
      },
      showPre: false,
      showSub: false
    },
    {
      field: 'password',
      type: 'password',
      lable: '密码',
      placeholder: '请输入密码',
      showPre: false,
      rules: [
        {
          required: true,
          message: '密码不能为空',
          trigger: 'blur'
        },
        {
          pattern: /^[a-z0-9]{4,20}$/,
          message: '密码是字母和数字长度为6-20位',
          trigger: 'blur'
        }
      ],
      otherOptions: {
        showPassword: true,
        clearable: true
      }
    }
  ],
  labelWidth: '70px',
  itemStyle: {
    padding: '5px 10px'
  },
  colLayout: {
    span: 24
  }
}
